package com.netty.pro.netty.inbound_outbound;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;

/**
 * @author xuzn
 * @ClassName: MychannelHandlerInitializer
 * @ProjectName netty-pro
 * @date 2020/3/20/10:24
 */
public class MyServerChannelHandlerInitializer extends ChannelInitializer<SocketChannel> {
  @Override
  protected void initChannel(SocketChannel ch) throws Exception {
    ChannelPipeline pipeline = ch.pipeline();
    pipeline.addLast(new MyByteToLongDecoder());
    pipeline.addLast(new MyLongToByteEncoder());
    pipeline.addLast(new InoutserverHandler());
  }
}
